package classes.pack;

import java.text.DateFormat;
import java.util.Date;



import com.google.android.maps.GeoPoint;

public class LogRecord 
{
	private AppStatus status;
	private GeoPoint location;
	private String dateTime;
	private LoggingType type;
	private String message;

	
	public LogRecord(AppStatus status) //status update without location
	{
				
		
		this.status = status;
		this.location = null;
		dateTime = (String) android.text.format.DateFormat.format("yyyy-MM-dd hh:mm:ss", new java.util.Date());
//DateFormat.getDateInstance().format(new Date());
		this.type = LoggingType.STATUS;
		this.message = null;
	}
	
	public LogRecord(AppStatus status, GeoPoint location) //status update with location
	{
		this.status = status;
		this.location = location;
		dateTime = (String) android.text.format.DateFormat.format("yyyy-MM-dd hh:mm:ss", new java.util.Date());
		//dateTime = DateFormat.getDateInstance().format(new Date());
		this.type = LoggingType.STATUS;
		this.message = null;
	}

	public LogRecord(GeoPoint location) //position update
	{
		this.status = null;
		this.location = location;
		dateTime = (String) android.text.format.DateFormat.format("yyyy-MM-dd hh:mm:ss", new java.util.Date());
		//dateTime = DateFormat.getDateInstance().format(new Date());
		this.type = LoggingType.POSITION_UPDATE;
		this.message = null;
	}
	public LogRecord(GeoPoint location, String message)					//log error
	{
		//location is optional
		this.status = null;
		this.location = location;
		dateTime = (String) android.text.format.DateFormat.format("yyyy-MM-dd hh:mm:ss", new java.util.Date());
		//dateTime = DateFormat.getDateInstance().format(new Date());
		this.type = LoggingType.ERROR;
		this.message = message;
	}
	
	public AppStatus getStatus()
	{
		return this.status;
	}
	
	public GeoPoint getLocation()
	{
		return this.location;
	}
	
	public String getDateTime()
	{
		return this.dateTime;
	}
	
	public LoggingType getLoggingType()
	{
		return this.type;
	}
	
	public String getMessage()
	{
		return this.message;
	}
	
}
